package com.example.backend2.service;

import com.example.backend2.dao.UserDao;
import com.example.backend2.entity.Result;
import com.example.backend2.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    UserDao userDao;

    public User login(User user){
        User user2 = userDao.findByName(user.getName());
        Result result = new Result();
        result.setCode(1);
        result.setBody(result);
        return user2;
    }

    public User save(User user){
        User u = userDao.save(user);
        return u;
    }
}
